import request from "@/utils/http";

// 获取菜单
export const getNavigation = (uid)=>{
  return request({
    url:'/permission/GetNavigationBar',
    params:{uid}
  })
}

// 获取菜单列表树
export const getDataList =(params)=>{
  return request({
    url:'/permission/GetTreeTable',
    params
  })
}
// 获取菜单列表树
export const getPermissionTree =(params)=>{
  // console.log(params)
  return request({
    url:'/permission/GetPermissionTree',
    params
  })
}


// 添加角色
export const addDate = (data)=>{
  console.log(data)
  return request({
    url:'/permission/Post',
    method:'post',
    data
  })
}
// 编辑角色
export const editDate = (data)=>{
  console.log(data)
  return request({
    url:'/permission/Put',
    method:'put',
    data
  })
}
// 删除角色数据
export const delDate = (params)=>{
  return request({
    url:'/permission/Delete',
    method:"delete",
    params
  })
}

// 获取角色授权的菜单数据
export const getPermissionIdsAPI = (params)=>{
  return request({
    url:'/permission/GetPermissionIdByRoleId',
    params
  })
}
// 保存授权
export const addRolePermissionAPI = (data)=>{
  return request({
    url:'/permission/Assign',
    method:'post',
    data
  })
}